package com.hf.config;

import javax.annotation.Resource;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.hf.interceptor.TokenInterceptor;

@Configuration
public class WebConfig implements WebMvcConfigurer {
	/**
	 * 拦截器注册
	 */
	@Resource
	private TokenInterceptor tokenInterceptor;

	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(tokenInterceptor).addPathPatterns("/**");
	}
}
